package com.example.controller;

import com.example.entity.Result;
import com.example.entity.Score;
import com.example.service.ScoreService;
import com.example.utils.ResultUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @Author: John
 * @Date 2019/5/6 11:18
 */
@RequestMapping("/Score")
@RestController
public class ScoreController {

    @Resource
    ScoreService scoreService;

    @GetMapping("/searchBystudentId")
    public Result searchBystudentId(String studentId){
        return ResultUtils.success(scoreService.searchBystudentId(studentId));
    }


    @PostMapping("/insertScore")
    public Result insertScore(Score score){
        return ResultUtils.success(scoreService.insertScore(score));
    }
}
